﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Collections;
using Easydp.Controllers;
using System.Web.Security;
namespace EasydpWebService
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://www.easydp.net/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class EtalkService : System.Web.Services.WebService
    {

        /// <summary>
        /// Check User
        /// </summary>
        /// <param name="param1">LoginName</param>
        /// <param name="param2">Password</param>
        /// <returns>User Ojbect</returns>
        [WebMethod]
        public ArrayList UserLogin(string param1, string param2)
        {
            ArrayList arrList = new ArrayList();
            if (Membership.ValidateUser(param1, param2))
            {
                AgentController controller = new AgentController();
                Easydp.Models.Entities.TT_Agent obj= controller.GetByLoginName(param1);
                arrList.Add(obj.AgentID);
                arrList.Add(obj.LoginName);
                arrList.Add(obj.AgentName);
                arrList.Add(obj.City);
            }
            return arrList;
         
        }
    }
}
